package com.ship.dispatch.controller;

import com.alibaba.fastjson.JSONObject;
import com.ship.common.core.web.domain.JsonResult;
import com.ship.dispatch.bo.ItemStatisticsSimpleBo;
import com.ship.dispatch.service.SpArrangeSchemeDetailService;
import com.ship.dispatch.service.report.ReportItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 数据看板统计接口 前端控制器
 *
 * @author zhangyh
 * @since 2024-01-10
 */
@RestController
@RequestMapping("/item/statistics")
@Api(value = "itemStatistics", tags = "数据看板统计接口前端控制器")
public class ItemStatisticsController {

    @Autowired
    private ReportItemService reportItemService;

    @Autowired
    private SpArrangeSchemeDetailService spArrangeSchemeDetailService;

    /**
     * 船货统计数量
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "船货统计数量")
    @PostMapping("/chtjsl")
    public JsonResult dispatchArrangeCount(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.dispatchArrangeCount(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 年度船货统计分布饼状图
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "年度船货统计分布饼状图")
    @PostMapping("/ndchtjfbbzt")
    public JsonResult yearDispatchArrangePieChart(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchArrangePieChart(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 年度船货统计分布柱状图
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "年度船货统计分布柱状图")
    @PostMapping("/ndchtjfbzzt")
    public JsonResult yearDispatchArrangeHistogram(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchArrangeHistogram(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 年度资源采购量
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "年度资源采购量")
    @PostMapping("/ndzycgl")
    public JsonResult yearDispatchArrangeBuyCount(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchArrangeBuyCount(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 已完成运输量
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "已完成运输量")
    @PostMapping("/ywcysl")
    public JsonResult yearDispatchArrangeFinishCount(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchArrangeFinishCount(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 资源完成率
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "资源完成率")
    @PostMapping("/zywcl")
    public JsonResult yearDispatchArrangeFinishRate(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchArrangeFinishRate(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 可用船舶统计柱状图
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "可用船舶统计柱状图")
    @PostMapping("/ddkycbtjzzt")
    public JsonResult yearDispatchShipStatisticsHistogram(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchShipStatisticsHistogram(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 可用船舶统计饼状图
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "可用船舶统计饼状图")
    @PostMapping("/ddkycbtjbzt")
    public JsonResult yearDispatchShipStatisticsPieChart(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchShipStatisticsPieChart(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 可用船舶天维度柱状图
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "可用船舶天维度柱状图")
    @PostMapping("/ddkycbtwdzzt")
    public JsonResult yearDispatchShipDayHistogram(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchShipHistogram(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 可用船舶天维度折线图
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "可用船舶天维度折线图")
    @PostMapping("/ddkycbtwdzxt")
    public JsonResult yearDispatchShipDayLineChart(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchShipDayLineChart(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 贸易利润率趋势图
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "贸易利润率趋势图")
    @PostMapping("/mylrlqst")
    public JsonResult yearDispatchTradeGetStatistics(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchTradeGetStatistics(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 已完成船货数量
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "已完成船货数量")
    @PostMapping("/ddywcchsl")
    public JsonResult yearDispatchFinishGoodsCount(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchFinishGoodsCount(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 执行中船货数量
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "执行中船货数量")
    @PostMapping("/ddzxzchsl")
    public JsonResult yearDispatchGoingGoodsCount(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchGoingGoodsCount(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 待执行船货数量
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "待执行船货数量")
    @PostMapping("/dddzxchsl")
    public JsonResult yearDispatchToExecuteGoodsCount(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchToExecuteGoodsCount(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 月度完成船货统计柱状图
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "月度完成船货统计柱状图")
    @PostMapping("/ydwcchtjzzt")
    public JsonResult yearDispatchMonthFinishGoodsHistogram(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchMonthFinishGoodsHistogram(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 月度完成船货统计折线图
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "月度完成船货统计折线图")
    @PostMapping("/ydwcchtjzxt")
    public JsonResult yearDispatchMonthFinishGoodsLineChart(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.yearDispatchMonthFinishGoodsLineChart(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 船舶租金折线图（现货西航线）
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "船舶租金折线图（现货西航线）")
    @PostMapping("/cbzjxhxhxzxt")
    public JsonResult shipRentNowWestLineChart(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.shipRentNowWestLineChart(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 船舶租金折线图（现货东航线）
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "船舶租金折线图（现货东航线）")
    @PostMapping("/cbzjxhdhxzxt")
    public JsonResult shipRentNowEastLineChart(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.shipRentNowEastLineChart(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 船舶租金折线图（六个月中长期）
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "船舶租金折线图（六个月中长期）")
    @PostMapping("/cbzjlgyzcqzxt")
    public JsonResult shipRentSixLineChart(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.shipRentSixLineChart(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 船舶租金折线图（十二个月中长期）
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "船舶租金折线图（十二个月中长期）")
    @PostMapping("/cbzjsegyzcqzxt")
    public JsonResult shipRentTwelveLineChart(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.shipRentTwelveLineChart(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 船舶租金折线图（三十六个月中长期）
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "船舶租金折线图（三十六个月中长期）")
    @PostMapping("/cbzjsslgyzcqzxt")
    public JsonResult shipRentThirtySixLineChart(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = spArrangeSchemeDetailService.shipRentThirtySixLineChart(bo);
        return JsonResult.success(resultJson);
    }


    /**
     * 资源合同备忘录统计
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "资源合同备忘录统计")
    @PostMapping("/zyhtbwl")
    public JsonResult conResourceMemorandumTotal(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conResourceMemorandumTotal(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 合同数量统计(所有类型的合同数量)
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "合同数量统计(所有类型的合同数量)")
    @PostMapping("/htsl")
    public JsonResult contractAllTypeNums(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.contractAllTypeNums(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 合同类型分布
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "合同类型分布")
    @PostMapping("/htlxfb")
    public JsonResult contractTypeDistribution(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.contractTypeDistribution(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 资源合同-主合同统计
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "资源合同-主合同统计")
    @PostMapping("/zyhtzht")
    public JsonResult conResourceMainTotal(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conResourceMainTotal(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 备忘录贸易类型分布
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "备忘录贸易类型分布")
    @PostMapping("/bwlmylxfb")
    public JsonResult conResourceMemorandumTradeType(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conResourceMemorandumTradeType(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 备忘录类贸易模式分布
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "备忘录类贸易模式分布")
    @PostMapping("/bwlmymsfb")
    public JsonResult conResourceMemorandumTradeModel(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conResourceMemorandumTradeModel(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 备忘录类贸易主体分布
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "备忘录类贸易主体分布")
    @PostMapping("/bwlmyztfb")
    public JsonResult conResourceMemorandumTradeBody(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conResourceMemorandumTradeBody(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 备忘录交付方式分布
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "备忘录交付方式分布")
    @PostMapping("/bwljffsfb")
    public JsonResult conResourceMemorandumDeliveryType(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conResourceMemorandumDeliveryType(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 备忘录状态分布
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "备忘录状态分布")
    @PostMapping("/bwlztfb")
    public JsonResult conResourceMemorandumStatus(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conResourceMemorandumStatus(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 主合同贸易主体分布
     *
     * @param bo
     * @return
     */
    @ApiOperation(value = "主合同贸易主体分布")
    @PostMapping("/zhtmyztfb")
    public JsonResult conResourceMainTradeBody(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conResourceMainTradeBody(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 船运合同统计
     * @param bo
     * @return
     */
    @ApiOperation(value = "船运合同统计")
    @PostMapping("/cyhttj")
    public JsonResult conShippingTotal(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conShippingTotal(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 船运合同类型分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "船运合同类型分布")
    @PostMapping("/cyhtlxfb")
    public JsonResult conShippingContractType(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conShippingContractType(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 不同类型备忘录状态分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "不同类型备忘录状态分布")
    @PostMapping("/btlxbwlztfb")
    public JsonResult memorandumTypeStatus(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.memorandumTypeStatus(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 船运合同贸易主体分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "船运合同贸易主体分布")
    @PostMapping("/cyhtmyztfb")
    public JsonResult conShippingTradeBody(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conShippingTradeBody(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 船舶租入贸易主体分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "船舶租入贸易主体分布")
    @PostMapping("/cbzrmyztfb")
    public JsonResult conShippingRentTradeBody(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conShippingRentTradeBody(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 船运合同类型及贸易主体分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "船运合同类型及贸易主体分布")
    @PostMapping("/cyhtlxjmyztfb")
    public JsonResult conShippingContractTypeAndTradeBody(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conShippingContractTypeAndTradeBody(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * 船运合同类型及状态分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "船运合同类型及状态分布")
    @PostMapping("/cyhtlxjztfb")
    public JsonResult conShippingContractTypeAndStatus(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.conShippingContractTypeAndStatus(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * LNG船舶状态分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "LNG船舶状态分布")
    @PostMapping("/lngcbztfb")
    public JsonResult lngShipStatus(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.lngShipStatus(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * LNG船舶船型分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "LNG船舶船型分布")
    @PostMapping("/lngcbcxfb")
    public JsonResult lngShipTypeGroup(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.lngShipTypeGroup(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * LNG船舶船龄分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "LNG船舶船龄分布")
    @PostMapping("/lngcbclfb")
    public JsonResult lngShipYearOfBuild(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.lngShipYearOfBuild(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * LNG船舶主机类型分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "LNG船舶主机类型分布")
    @PostMapping("/lngcbzjlxfb")
    public JsonResult lngShipMainEngineType(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.lngShipMainEngineType(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * LNG船舶建造船厂分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "LNG船舶建造船厂分布")
    @PostMapping("/lngcbjzccfb")
    public JsonResult lngShipbuilder(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.lngShipbuilder(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * LNG船舶建造国家分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "LNG船舶建造国家分布")
    @PostMapping("/lngcbjzgjfb")
    public JsonResult lngShipCountryOfBuild(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.lngShipCountryOfBuild(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * LNG船舶船级社分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "LNG船舶船级社分布")
    @PostMapping("/lngcbjsfb")
    public JsonResult lngShipClassificationSociety(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.lngShipClassificationSociety(bo);
        return JsonResult.success(resultJson);
    }

    /**
     * LNG船舶经营公司分布
     * @param bo
     * @return
     */
    @ApiOperation(value = "LNG船舶经营公司分布")
    @PostMapping("/lngcbjygsfb")
    public JsonResult lngShipOperator(@RequestBody ItemStatisticsSimpleBo bo) {
        JSONObject resultJson = reportItemService.lngShipOperator(bo);
        return JsonResult.success(resultJson);
    }
}
